package com.jy.api.domain;

import com.jy.api.enums.SendTypeEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Transient;

import javax.persistence.*;
import java.util.Date;

/**
 * Created by lihu on 2018/1/16.
 */
@Entity
@Data
@NoArgsConstructor
public class StoreOrder {


    @Id
    @Column(length = 50)
    private String id;

    @Column(length = 50)
    private String storeId;

    private int amount;//具体金额

    private int qty;//发送会员数量

    @Transient
    private String ip;

    private boolean success = false;

    private SendTypeEnum type = SendTypeEnum.WECHAT;

    private String sendId;

    @Column(insertable = false, updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date addTime;
    @Column(insertable = false, updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date updateTime;

    public StoreOrder(String id, String storeId,
                      int amount, int qty, String sendId, String ip) {
        this.id = id;
        this.storeId = storeId;
        this.amount = amount;
        this.qty = qty;
        this.sendId = sendId;
        this.ip = ip;
    }
}
